//
//  RootViewController.m
//  PeitaMerchants
//
//  Created by apple on 17/8/22.
//  Copyright © 2017年 Facebook. All rights reserved.
//

#import "RootViewController.h"
#import "ChatViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewWillAppear:(BOOL)animated {
  
  [super viewWillAppear:animated];
  
  self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
  [super viewWillDisappear:animated];
  
  self.navigationController.navigationBarHidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
  
  self.view.backgroundColor = [UIColor whiteColor];
  
//  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openChat:) name:@"openChat" object:nil];
  
}

//- (void)openChat:(NSNotification *)openChatNot {
//  
//  NSLog(@"收到了打开聊天界面");

//  dispatch_async(dispatch_get_main_queue(), ^{
//    
//    NSDictionary *dict = [openChatNot object];
//    ChatViewController *chatVC = [[ChatViewController alloc] init];
//    chatVC.name = dict[@"userName"];
//    chatVC.targetId = dict[@"userId"];
//    if ([dict[@"status"] isEqualToNumber:@1]) {
//      
//      // 单聊
//      chatVC.conversationType = ConversationType_PRIVATE;
//    } else {
//      
//      // 群聊
//      chatVC.conversationType = ConversationType_GROUP;
//    }
//    [self.childViewControllers[0] pushViewController:chatVC animated:YES];
//  });
  
  
//}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
